import request from '@/utils/request'

export function fetchMerchantBase() {
  return request({
    url: 'backend_get_merchant_type',
    method: 'get'
  })
}
export function handleCreateSubmit(data) {
  return request({
    url: 'merchant_base_crreate',
    method: 'post',
    data
  })
}
export function getMerchantAccount(data) {
  return request({
    url: 'getMerchantAccount',
    method: 'post',
    data
  })
}
export function publiceAccountSubmit(data) {
  return request({
    url: 'publiceAccountSubmit',
    method: 'post',
    data
  })
}
export function getMerchantBaseList(data) {
  return request({
    url: 'merchant_base_list',
    method: 'post',
    data
  })
}
export function getBaseMerchantMain(data) {
  return request({
    url: 'merchant_base_detail_main',
    method: 'post',
    data
  })
}
export function getMerchantShareholder(data) {
  return request({
    url: 'merchant_base_shareholder',
    method: 'post',
    data
  })
}
export function saveMerchant(data) {
  return request({
    url: 'merchant_base_save',
    method: 'post',
    data
  })
}
export function addMerchantContactor(data) {
  return request({
    url: 'merchant_add_contactor',
    method: 'post',
    data
  })
}
export function getMerchantInstallmentOrganization(data) {
  return request({
    url: 'merchant_installment_organization',
    method: 'post',
    data
  })
}
export function onSubmitAttachment(data) {
  return request({
    url: 'submit_merchant_attachment',
    method: 'post',
    data
  })
}
export function MerchantContactorList(data) {
  return request({
    url: 'merchant_contactor_list',
    method: 'post',
    data
  })
}
export function createAccount(data) {
  return request({
    url: 'merchant_create_account',
    method: 'post',
    data
  })
}
export function MerchantAccountList(data) {
  return request({
    url: 'merchant_account_list',
    method: 'post',
    data
  })
}
export function fetchMerchantRegion(query) {
  return request({
    url: 'backend_get_region',
    method: 'get',
    params: query
  })
}
export function fetchList(query) {
  return request({
    url: 'backend_get_merchant_list',
    method: 'get',
    params: query
  })
}
export function merchantList(query) {
  return request({
    url: '/merchant/getMerchantList',
    method: 'get',
    params: query
  })
}
export function exceloutmerchant(query) {
  return request({
    url: 'excel_merchant',
    method: 'get',
    params: query
  })
}
export function merchantListOnlyMerchant(query) {
  return request({
    url: 'backend_merchant_and_sale',
    method: 'get',
    params: query
  })
}
export function fetchMerchant(id) {
  return request({
    url: '/merchant/detail',
    method: 'get',
    params: { id }
  })
}

export function deleteMerchant(data) {
  return request({
    url: '/merchant/delete/' + data,
    method: 'delete'
  })
}

export function fetchMerchantScheduleList(data) {
  return request({
    url: 'backend_haier_merchang_schedule',
    method: 'post',
    data
  })
}
export function merchantScheduleCreateOrUpdate(data) {
  return request({
    url: 'merchant_schedule_create_or_update',
    method: 'post',
    data
  })
}
export function showMerchantScheduleLog(data) {
  return request({
    url: 'merchant_schedule_log',
    method: 'post',
    data
  })
}
export function exceloutMerchantSchedule(data) {
  return request({
    url: 'excelout_merchant_schedule',
    method: 'post',
    data
  })
}
export function merchantScheduleConditon(data) {
  return request({
    url: 'backend_haier_merchang_schedule_condition',
    method: 'post',
    data
  })
}
export function createMerchant(data) {
  return request({
    url: 'backend_merchant_createupdate',
    method: 'post',
    data
  })
}
export function createHaierMerchant(data) {
  return request({
    url: 'backend_haier_merchant_createupdate',
    method: 'post',
    data
  })
}
export function haierOnlineSubmit(data) {
  return request({
    url: 'backend_merchant_online',
    method: 'post',
    data
  })
}

export function updateMerchant(data) {
  return request({
    url: 'backend_merchant_createupdate',
    method: 'put',
    data
  })
}

export function updateMerchantStatus(data) {
  return request({
    url: '/merchant/updateStatus',
    method: 'put',
    data
  })
}
export function updateMerchantChecked(data) {
  return request({
    url: '/merchant/updateMerchantChecked',
    method: 'put',
    data
  })
}
export function changeSignDate(data) {
  return request({
    url: '/merchant/changeSignDate',
    method: 'post',
    data
  })
}
export function changeMerchantAuth(data) {
  return request({
    url: 'backend_merchant_auth_esign',
    method: 'post',
    data
  })
}
